import $ from 'jquery';
//这个写法是只读的
//import BpmnModeler from 'bpmn-js';
//这个写法是可编辑的
import BpmnModeler from 'bpmn-js/lib/Modeler';
import testDiagram from './diagram.bpmn';
import propertiesPanelModule from 'bpmn-js-properties-panel';
import propertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda';

var viewer = new BpmnModeler({
  container: '#js-canvas',
	//添加控制板
	propertiesPanel: {
		parent: '#js-properties-panel'
	},
	additionalModules: [
		propertiesPanelModule,
		// 左边工具栏以及节点
		propertiesProviderModule
	]
});

viewer.importXML(testDiagram, function(err) {
  if (!err) {
    console.log('success!');
    viewer.get('canvas').zoom('fit-viewport');
  } else {
    console.log('something went wrong:', err);
  }
});
